/* 
 * MacHash - A simple utility that takes a filename or a string and creates
 * a digest of the contents using the select hash type.  MacHash acts as a 
 * Cocoa UI to the OpenSSL hash libraries.
 *
 * Copyright (C) 2006 Rick Russell - machash at idatasys dot com
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
  
/* Hash */

#import <Cocoa/Cocoa.h>
#import <openssl/md2.h>
#import <openssl/md4.h>
#import <openssl/md5.h>
#import <openssl/sha.h>
#import <stdlib.h>

@interface Hash : NSObject
{
	unsigned char *digest;
	long digestLen;
	int fileBufferSize;
}

- (NSString *)createStringHash:(NSString *)textInput hashType:(NSString *)digestType;
- (NSString *)createFileHash:(NSString *)filePath hashType:(NSString *)digestType;
- (void)createStringMD2Digest:(unsigned char *)input length:(long)inputLen;
- (void)createStringMD4Digest:(unsigned char *)input length:(long)inputLen;
- (void)createStringMD5Digest:(unsigned char *)input length:(long)inputLen;
- (void)createStringSHA1Digest:(unsigned char *)input length:(long)inputLen;
- (void)createFileMD2Digest:(NSFileHandle *)file;
- (void)createFileMD4Digest:(NSFileHandle *)file;
- (void)createFileMD5Digest:(NSFileHandle *)file; 
- (void)createFileSHA1Digest:(NSFileHandle *)file; 
- (void)allocDigest;
- (void)freeDigest;
- (int)fileBufferSize;
- (void)setFileBufferSize:(int)size;

@end
